package com.tspp.dao;

import com.tspp.dao.dto.Application;
import java.util.List;

/**
 * Interface for application dao. Contains crud operation
 * @author Maks
 */
public interface ApplicationDao {

    /**
     * Inserts a new row in the APPLICATION table.
     */
    public void insert(Application dto) throws DaoException;

    /**
     * Updates a single row in the APPLICATION table.
     */
    public void update(int speciality, int entrant, Application dto) throws DaoException;

    /**
     * Deletes a single row in the APPLICATION table.
     */
    public void delete(int speciality, int entrant) throws DaoException;

    /**
     * Returns all rows from the APPLICATION table that match the criteria 'ID_ENTRANT = :idEntrant AND ID_SPECIALITY = :idSpeciality'.
     */
    public Application findByPrimaryKey(int idEntrant, int idSpeciality) throws DaoException;

    /**
     * Returns all rows from the APPLICATION table that match the criteria ''.
     */
    public List<Application> findAll() throws DaoException;

    /**
     * Returns all rows from the APPLICATION table that match the criteria 'ID_ENTRANT = :idEntrant'.
     */
    public List<Application> findByEntrant(int idEntrant) throws DaoException;

    /**
     * Returns all rows from the APPLICATION table that match the criteria 'ID_SPECIALITY = :idSpeciality'.
     */
    public List<Application> findBySpeciality(int idSpeciality) throws DaoException;

    /**
     * Returns all rows from the APPLICATION table that match the criteria 'ACCEPTED = :accepted'.
     */
    public List<Application> findWhereAcceptedEquals(boolean accepted) throws DaoException;
}

